<!--
 * @Description: 
 * @Author: mxy
 * @Date: 2022-11-18 21:13:30
 * @LastEditors: mxy
 * @LastEditTime: 2022-11-18 21:23:29
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const data = [
            { name: '北京', value: 10 },
            { name: '河北省', value: 8 },
            { name: '山西省', value: 5 },
            { name: '内蒙古自治区', value: 7 },
        ]
        const mapData = [
            { name: '南海诸岛', value: 0 },
            { name: '北京', value: 0 },
            { name: '山西', value: 0 },
            { name: '上海', value: 0 },
            { name: '重庆', value: 0 },
            { name: '河北', value: 0 },
        ]
        mapData.forEach(item => {
            data.find(i => {
                if (i.name.includes(item.name)) {
                    item.value = i.value
                }
            })
        })
        console.log(mapData)
    </script>
</body>

</html>